package caldremch.com.socketprocess;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.Process;
import android.util.Log;

import java.util.Timer;
import java.util.TimerTask;

public class MyPushService extends Service {

    int i = 0;

    @androidx.annotation.Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }


    @Override
    public void onCreate() {
        super.onCreate();

        Timer timer = new Timer();

        MyWatcher myWatcher = new MyWatcher();
        myWatcher.socketServer(String.valueOf(Process.myUid()));
        myWatcher.socketClient();

        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                Log.e("Caldremch", "服务端开启中" + i);
                i++;
            }
        }, 0, 1000 * 3);


    }
}
